package com.designpattern.strategy;

import sourceanalysis.com.mylibrary.strategylib.Strategy;
import sourceanalysis.com.mylibrary.strategylib.StrategyClass;

public class StrategyPattern {

    public static void main(String[] args) {
        Strategy.doStrategy(new StrategyA()); // 执行A策略

        Strategy.doStrategy(new StrategyB()); // 执行B策略
    }

    static class StrategyA extends StrategyClass {

        @Override
        public void doSmothing() {
            System.out.println("do A strategy");
        }
    }

    static class StrategyB extends StrategyClass {

        @Override
        public void doSmothing() {
            System.out.println("do B strategy");
        }
    }
}
